<!-- <script>


export default {
  name: 'LoginView',
  data() {
    // 用户名规则
    const checkUsername = (rule, value, callback) => {
      if (!value) {
        return callback(new Error('用户名不能为空'));
      }
      else {
        callback();
      }
    };
    // 密码规则
    const validatePass = (rule, value, callback) => {
      if (value === '') {
        callback(new Error('请输入密码'));
      } else {
        callback();
      }
    };
    return {
      ruleForm: {
        username: '',
        pass: '',
      },
        // 校验
      rules: {
        username: [
          {validator: checkUsername, trigger: 'blur'}
        ],
        pass: [
          {validator: validatePass, trigger: 'blur'}
        ],
      },
    }
  },
  methods: {
    login(){
        this.$router.push('/userInfoReg')
    }
    // toRegister() {
    //   this.LoginComponents = !this.LoginComponents
    // }
  },

}
</script>

<template>
  <div class="main">
    <el-row :gutter="24" style="display: flex;justify-content: center;align-items: center;padding-top: 200px;">
      <el-col :span="8">
        <div class="grid-content bg-purple"></div>
      </el-col>
      <el-col :span="8" id="main_bord" style="box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1)">
        <div class="grid-content bg-purple">
          <el-form :model="ruleForm" status-icon :rules="rules" ref="ruleForm" label-width="100px"
                   class="demo-ruleForm">
            <el-form-item label="用户名" prop="username">
              <el-input v-model.number="ruleForm.username"></el-input>
            </el-form-item>
            <el-form-item label="密码" prop="pass">
              <el-input type="password" v-model="ruleForm.pass" autocomplete="off"></el-input>
            </el-form-item>
            <el-form-item>
              <el-button type="primary" @click="login">登录</el-button>

            </el-form-item>
          </el-form>
        </div>
      </el-col>
      <el-col :span="8">
        <div class="grid-content bg-purple"></div>
      </el-col>
    </el-row>

  </div>
</template>

<style scoped>
.main{
    width: 100%;
    height: 100%;
    background-image: url('../../assets/a15d12c3826a42158a58ef11fb53cd78-00001.jpg');
    background-repeat: no-repeat;
    background-size: 100% 100%;
}
.grid-content {
  border-radius: 4px;
  min-height: 36px;
}
.grid-content /deep/ .el-form-item__label{
    color:#fff
}
.grid-content /deep/ .el-input__inner{
    width: 400px;
}
.grid-content /deep/ .el-input{
    width: 400px;
}
</style> -->
